<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/HeaderTopMenuTemplate.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:define name="conteudo">
        <p:panel id="pnlCadastro" header="Cadastro">
            <h:panelGrid columns="2">
                <p:outputLabel for="txtTitulo" value="Título:" styleClass="negrito" />
                <p:inputText id="txtTitulo" size="50" maxlength="100" value="#{livroCadastroForm.titulo}"/>
                <p:outputLabel for="txtISBN" value="ISBN:" styleClass="negrito" />
                <p:inputMask id="txtISBN" value="#{livroCadastroForm.isbn}" mask="9999-999999" />
                <p:outputLabel for="dtePublicacao" value="Publicado em:" styleClass="negrito" />
                <p:calendar id="dtePublicacao" pattern="dd/MM/yyyy" 
                            value="#{livroCadastroForm.dataPublicacao}"/>
                <p:outputLabel for="selTipo" value="Tipo:" styleClass="negrito" />
                <p:selectOneMenu id="selTipo" value="#{livroCadastroForm.idLivroTipo}" >
                    <f:selectItems value="#{livroCadastroForm.livroTipos}" 
                                   var="tipo" itemLabel="#{tipo.descricao}" itemValue="#{tipo.id}"/>
                </p:selectOneMenu>
             </h:panelGrid>
             <h:panelGrid columns="2">
                 <p:commandButton id="btnOK" value="OK" action="#{livroCadastroForm.onBotaoOKClick}" icon="ui-icon-check" />
                 <p:commandButton id="btnCancelar" value="Cancelar" immediate="true" action="/livroConsultaForm.xhtml?faces-redirect=true"  icon="ui-icon-cancel" />
             </h:panelGrid>
        </p:panel>
    </ui:define>

</ui:composition>
